PListMom


Manages a list returned by a PageMaker query. A query list starts with a 16-bit count field, followed by that number of records, which may be fixed length or varying length.

The PListQuery class uses a PListMom object to manage a list returned by a query.


Constructor

PListMom();
This constructor initializes the member fields to zero. To use a PListMom object, it must be assigned a starting address using operator= (below).

Member functions

PListMom& operator=(const char * buf);
This function initializes the list mom's starting point. Before the list mom object can be used, its starting address must be set with this funtion.
The first two bytes at the specified address are assumed to be a count of the number of items in the list.
This is a separate function from the constructor so that PListMom objects can be created as members of other objects, rather than being created as separate heap objects with the new operator.
const char * Current() const;
Returns a pointer to the current record.
short Count() const;
Returns the number of items the list mom is responsible for.
void Reset();
Reset the curItemPtr to the start of the list (which starts immediately after the 16-bit length field).
void Update(const char * ch);
This function is called to update the curItem and curItemPtr fields. If past the number of items, this wraps around to the first item.

Member fields

All fields are private to the class.

short numItems;

The total number of items in the list.
const char * itemsPtr;
Points to the start of the first item in the list.
short curItem;
An index to the current item. This should always be between 0 and numItems-1.
const char * curItemPtr;
Points to the start of the current item.

Copyright © 1996, Adobe Systems Incorporated. All rights reserved.

Comments or suggestions? Contact Adobe Developer Support